import { createVNode, render } from 'vue'
import YkMessage from './YkMessage.vue'

const divVNode = createVNode('div',{ class: 'xtx-message-container' })
render(divVNode, document.body)

const div = divVNode.el


const YKmessage = ({ message, type }) => {
    // 动态创建
    const comVNode = createVNode(YkMessage, { message, type })
    // 渲染
    render(comVNode, div)
    // 自动卸载
    setTimeout(() => {
        render(null, div)
    }, 6000)
}

export default YKmessage